# coding:utf-8
# @Author: Mercur1o
# @Software: PyCharm
# @File : exerc3.py
# @Time: 2024/3/12 13:20
def count_characters(input_str):
    letter_count = 0
    digit_count = 0
    space_count = 0
    other_count = 0

    for char in input_str:
        if char.isalpha():
            letter_count += 1
        elif char.isdigit():
            digit_count += 1
        elif char.isspace():
            space_count += 1
        else:
            other_count += 1

    return letter_count, digit_count, space_count, other_count

# 提示用户输入一行字符，并保存在input_str变量中
input_str = input("请输入一行字符：")

# 调用统计函数，并打印结果
letter_count, digit_count, space_count, other_count = count_characters(input_str)
print("英文字母个数：", letter_count)
print("数字个数：", digit_count)
print("空格个数：", space_count)
print("其他字符个数：", other_count)
